<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateFinance2Table extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('finance2', function(Blueprint $table)
		{
			$table->increments('id');
			$table->integer('project');
			$table->integer('incoming_payment_amount')->nullable();
			$table->string('incoming_payment_amount_currency', 3)->nullable()->default('RMB');
			$table->string('customer_source')->nullable();
			$table->integer('outgoing_payment_amount')->nullable();
			$table->string('outgoing_payment_amount_currency', 3)->nullable()->default('RMB');
			$table->text('beneficiary')->nullable();
			$table->string('project_number')->nullable();
			$table->string('PO_number')->nullable();
			$table->string('invoice_number')->nullable();
			$table->text('reason')->nullable();
			$table->dateTime('planned_incoming_payment_date')->nullable();
			$table->dateTime('actual_incoming_payment_date')->nullable();
			$table->string('difference1')->nullable();
			$table->integer('incoming_payment_status')->nullable();
			$table->integer('actual_incoming_payment_amount_received')->nullable();
			$table->dateTime('planned_outgoing_payment_date')->nullable();
			$table->dateTime('actual_outgoing_payment_date')->nullable();
			$table->string('difference2')->nullable();
			$table->integer('outgoing_payment_status')->nullable();
			$table->integer('actual_outgoing_payment_amount_paid')->nullable();
			$table->timestamps();
			$table->softDeletes();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('finance2');
	}

}
